package com.example.c5c6;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
@WebServlet("/RegisterServlet")
public class RegisterServlet  extends HttpServlet {
    protected  void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        request.setCharacterEncoding("UTF-8");
        String username = request.getParameter("username");
        String useerword = request.getParameter("userword");
        String email = request.getParameter("email");
        String userSex = request.getParameter("userSex");
        String userEducation = request.getParameter("userEducation");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head><title>用户注册结果</title> </head>");
        out.println("<body>");
        out.println("<h3>用户注册结果</h3>");
        out.println("<table border=1 align=left");
        out.println("<tr><th>参数</th><th>参数值</th></tr>");
        out.println("<tr><td>userName</td><td>"+username+"</td></tr>");
        out.println("<tr><td>userPwd</td><td>"+userSex+"</td></tr>");
        out.println("<tr><td>email</td><td>"+email+"</td></tr>");
        out.println("<tr><td>userSex</td><td>"+userSex+"</td></tr>");
        out.println("<tr><td>userEducation</td><td>"+userEducation+"</td></tr>");
        out.println("</table></BODY>");
        out.println("</html>");
        out.flush();
        out.close();
    }
    protected  void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

}
